package com.yongbao.model.util;

import com.yongbao.model.dtomapper.AdminDtoMapper;
import com.yongbao.model.domain.AdminDO;
import com.yongbao.model.vo.AdminVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class AdminConvert {

    public static List<AdminVO> buildAdminVoList(List<AdminDO> adminDOList) {
        if (CollectionUtils.isEmpty(adminDOList)) {
            return Lists.newArrayList();
        }
        List<AdminVO> adminVOList = new ArrayList<>();
        for (AdminDO adminDO : adminDOList) {
            adminVOList.add(AdminDtoMapper.INSTANCE.do2VO(adminDO));
        }

        return adminVOList;
    }
}
